<?php
class Nadeb_Form_JSFolder extends Nadeb_Form_Dataform
{
	private $Nadeb_object;
	private $param;
	private $label;
	private $options;
	
	public function __construct($_param)
	{
		$this->param   = $_param;
		unset($this->param["rules"]);
		if( isset( $this->param["label"]   ) ) $this->label   = $_param["label"];
		if( isset( $this->param["options"] ) ) $this->options = $_param["options"];
		if( isset( $this->param["options"] ) ) unset($this->param["options"]);
		if( isset( $this->param["label"]   ) ) unset($this->param["label"]);
	}
	
	public function create_object()
	{
		$dt       = new Nadeb_Form_Xhtml("dt");
		$dt->attr = array(
						"id" => $this->param["id"],
						);
		
		$div       = new Nadeb_Form_Xhtml("div");
		$div->attr = array(
						"class" => $this->param["colum"],
						);
		
		$fItem        = new Nadeb_Form_Xhtml("input");
		$fItem->attr  = array(
						"type" => "file",
						"name" => "addfiles",
						);

		$sFile        = new Nadeb_Form_Xhtml("input");
		$sFile->attr  = array(
						"type" => "button",
						"class" => "addFolder",
						"value" => "Enviar Arquivos",
						);
						
		$legsav       = new Nadeb_Form_Xhtml("input");
		$legsav->attr = array(
						"type"  => "button",
						"class" => "save_legend",
						"value" => "Salvar Legendas",
						);
		
		$div->add("<h1>Galeria de Imagens</h1>");
		$div->add($fItem->get_xhtml());
		$div->add($sFile->get_xhtml());
		$div->add($legsav->get_xhtml());
		$div->add("<div></div>");
		
		$dt->add( $div->get_xhtml() );

		$this->Nadeb_object["label"] = $dt->get_xhtml();
		$this->Nadeb_object["input"] = "";

	}
	
	public function get_label()
	{
		return $this->Nadeb_object["label"];
	}
	
	public function get_input()
	{
		return $this->Nadeb_object["input"];
	}
}
